package demon;

import java.util.ArrayList;
import java.util.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 21626
 * Date: 2024-10-16
 * Time: 16:52
 */
public class Test {
    public static void main(String[] args) {
        Game game = new Game();
        List<Card> cardList = game.CreatCards();
        System.out.println(cardList);
        game.shufflr(cardList);
        System.out.println(cardList);
        List<List<Card>> hand = game.play(cardList);
        for (int i = 0; i < hand.size(); i++) {
            System.out.println("第" + (i+1) + "个人的牌是" + hand.get(i));
        }
        System.out.println(cardList);

    }
    //杨辉三角
        public List<List<Integer>> generate(int numRows) {
            List<List<Integer>> list = new ArrayList<>();
            //第一行
            List<Integer> list1 = new ArrayList<>();
            list1.add(1);
            list.add(list1);

            //从第二行开始
            for (int i = 1; i < numRows; i++) {

                //每一行开始
                List<Integer> tmp = new ArrayList<>();
                tmp.add(1);
                //每一行中间

                List<Integer> preRows = list.get(i-1);//前一行
                for (int j = 1; j < i; j++) {
                    int val1 = preRows.get(j);
                    int val2 = preRows.get(j-1);
                    int val = val1 + val2;
                    tmp.add(val);
                }
                //每一行结尾
                tmp.add(1);
                list.add(tmp);
            }
            return list;
        }
    public static void main1(String[] args) {
        ArrayList<Integer> list = new ArrayList<>();
        list.add(1);
        list.add(2);
        ArrayList<Integer> tmpList = new ArrayList<>(list);
        tmpList.add(99);
        System.out.println(tmpList);
    }
}
